package com.mindata.blockchain.common;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author wuweifeng wrote on 2018/3/17.
 */
@Component
public class AppId {
    /**
     * 节点的唯一标志
     */
    @Value("${appId}")
    private String applicationId;
    /**
     * 该客户的唯一标志
     */
    @Value("${name}")
    private String name;

    private static String value;
    private static String nameValue;


    @PostConstruct
    public void init() {
        AppId.setNameValue(this.name);
        AppId.setValue(this.applicationId);

    }

    public static void setValue(String value) {
        AppId.value = value;
    }

    public static void setNameValue(String nameValue) {
        AppId.nameValue = nameValue;
    }

    public static String getValue() {
        return value;
    }

    public static String getNameValue() {
        return nameValue;
    }
}
